package com.zlt.util;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisUtil {

    private static JedisPool jedisPool;

    static {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxTotal(100);
//        jedisPool = new JedisPool(jedisPoolConfig, "192.168.150.10", 6379, 10000, "123456");
        jedisPool = new JedisPool(jedisPoolConfig, "127.0.0.1",6379,10000);//wbh
    }

    public static Jedis getConnection() {
        return jedisPool.getResource();
    }

}
